const common = require("../../common");
const jwt = require('jsonwebtoken');
const CONSTANT = require('../../common/constant');

module.exports = {
    login: (req, res) => {
        if (req.body && req.body.email) {
            console.log(req.body.email);
        }
        if (req.body && req.body.password) {
            console.log(req.body.password);
        }
        //console.log(req);
        const token = 'Bearer ' + jwt.sign({ id: 10005 }, CONSTANT.SECRET_KEY, { expiresIn: 3600 * 24 * 15 })
        common.jsonWrite(res, token)
    }
};